#ifndef _SQLITE3_GLOBAL_H_
#define _SQLITE3_GLOBAL_H_


/*  表0   */
fields_t fields0[3] = {
	{"name", TYPE_TEXT },
	{"password", TYPE_TEXT },
	{"**"},
};
table_t table0 = {
	.fields = fields0,
	.tableName = USER,
};

/* 表 1  */
fields_t fields1[5] = {
	{"id", "INTEGER PRIMARY KEY", "AUTOINCREMENT"},
	{"no", TYPE_TEXT },
	{"name", TYPE_TEXT },
	{"time", TYPE_TEXT},
	{"**"},
};
table_t table1 = {
	.fields = fields1,
	.tableName = STORAGE1IN,
};

/* 表 2  */
fields_t fields2[5] = {
	{"id", "INTEGER PRIMARY KEY", "AUTOINCREMENT"},
	{"no", TYPE_TEXT },
	{"name", TYPE_TEXT },
	{"time", TYPE_TEXT},
	{"**"},
};
table_t table2 = {
	.fields = fields2,
	.tableName = STORAGE1OUT,
};

/* 表 3  */
fields_t fields3[6] = {
	{"id", "INTEGER PRIMARY KEY", "AUTOINCREMENT"},
	{"no", TYPE_TEXT },
	{"name", TYPE_TEXT },
	{"state", TYPE_TEXT },
	{"time", TYPE_TEXT},
	{"**"},
};
table_t table3 = {
	.fields = fields3,
	.tableName = STORAGE1INFO,
};

/* 表 4 */
fields_t fields4[9] = {
	{"id", "INTEGER PRIMARY KEY", "AUTOINCREMENT"},
	{"temp", TYPE_TEXT },
	{"hum", TYPE_TEXT },
	{"light", TYPE_INT },
	{"x", TYPE_INT },
	{"y", TYPE_INT },
	{"z", TYPE_INT },
	{"time", TYPE_TEXT},
	{"**"},
};
table_t table4 = {
	.fields = fields4,
	.tableName = ENVI1,
};

/* 数据库定义 */
db_t sqt = {
	.db = NULL,
	.path = DATABASE_PATH,
	.tables = {&table0, &table1, &table2, &table3, &table4},
};





#endif
